<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head th:include="public/page_css::page_css ('新增收发类别')" />

<body>
<div class="layui-fluid larry-wrapper">
    <div class="layui-row layui-col-space30">
        <div class="layui-col-xs24">
            <section class="panel panel-padding">
                <form id="form1" class="layui-form layui-form-pane" action="">


                    <div class="layui-form-item">
                        <label class="layui-form-label">订单类型</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="ddlx" id="ddlx" placeholder="请输入订单类型" />
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">订单分类</label>
                            <div class="layui-input-inline">

                                <select name="fl"  id="flSelect" lay-search>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">订单类型代码</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="lxdm" id="lxdm" placeholder="" />
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" jq-filter="submit" lay-submit="" lay-filter="addHuopin">保存</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </section>
        </div>
    </div>
</div>
</body>
<div th:include="public/public_js::public_js"></div>

<script th:inline="javascript">
    $(function () {

    })

</script>
<script>
    layui.use(['myform','zzpUtils','form','jquery'],function () {
        var form = layui.form,
            zzpUtils = layui.zzpUtils,
            $ = layui.jquery;



        form.on("submit(addHuopin)",function(data){
           // console.log(zzpUtils.getFormJson($("#form1")));
            zzpUtils.confirm("是否确定添加",function(index){
                zzpUtils.action({
                    url:"/wmsOwnerOrderType/add",
                    data:JSON.stringify(data.field),
                    success:function (data) {
                        setTimeout(function(){
                            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                            parent.layer.close(index); //再执行关闭
                            top.layer.msg(data.title);
                        },500);
                    },error: function (xhr, textStatus) {
                        console.log(textStatus);
                        console.log(xhr);
                    }
                })
            })
            return false;
        });


        //查询字典表中的数据 订单分类
        zzpUtils.select({
            elem:"#flSelect",    //dom
            url:"/sysdictionary/getSysdictionary/wms_owner_ordertype_fl"
            //路径 以"/"开头，后边正常字典路径
        });
    });
</script>
</html>